package model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the COMPLAINT database table.
 * 
 */
@Entity
public class Complaint implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="COMPLAINT_CD")
	private String complaintCd;

	@Column(name="COMPLAINT_DESC")
	private String complaintDesc;

	//bi-directional many-to-one association to CustComplaint
	@OneToMany(mappedBy="complaint")
	private List<CustComplaint> custComplaints;

	public Complaint() {
	}

	public String getComplaintCd() {
		return this.complaintCd;
	}

	public void setComplaintCd(String complaintCd) {
		this.complaintCd = complaintCd;
	}

	public String getComplaintDesc() {
		return this.complaintDesc;
	}

	public void setComplaintDesc(String complaintDesc) {
		this.complaintDesc = complaintDesc;
	}

	public List<CustComplaint> getCustComplaints() {
		return this.custComplaints;
	}

	public void setCustComplaints(List<CustComplaint> custComplaints) {
		this.custComplaints = custComplaints;
	}

	
	public CustComplaint addCustComplaints(CustComplaint custComplaints) {
		getCustComplaints().add(custComplaints);
		custComplaints.setComplaint(this);

		return custComplaints;
	}

	public CustComplaint removeCustComplaints(CustComplaint custComplaints) {
		getCustComplaints().remove(custComplaints);
		custComplaints.setComplaint(null);

		return custComplaints;
	}
}